Optimal. Leaf size=121 \[ -\frac {3 a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}+\frac {11 a^2 \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {5 a \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) (a+a \sin (c+d x))^{3/2}}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.21, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2795, 3055,
3060, 2852, 212} \begin {gather*} -\frac {3 a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a \sin (c+d x)+a}}\right )}{d}+\frac {11 a^2 \cos (c+d x)}{3 d \sqrt {a \sin (c+d x)+a}}+\frac {5 a \cos (c+d x) \sqrt {a \sin (c+d x)+a}}{3 d}-\frac {\cot (c+d x) (a \sin (c+d x)+a)^{3/2}}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2795
Rule 2852
Rule 3055
Rule 3060
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+a \sin (c+d x))^{3/2} \, dx &=-\frac {\cot (c+d x) (a+a \sin (c+d x))^{3/2}}{d}+\frac {\int \csc (c+d x) \left (\frac {3 a}{2}-\frac {5}{2} a \sin (c+d x)\right ) (a+a \sin (c+d x))^{3/2} \, dx}{a}\\ &=\frac {5 a \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) (a+a \sin (c+d x))^{3/2}}{d}+\frac {2 \int \csc (c+d x) \sqrt {a+a \sin (c+d x)} \left (\frac {9 a^2}{4}-\frac {11}{4} a^2 \sin (c+d x)\right ) \, dx}{3 a}\\ &=\frac {11 a^2 \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {5 a \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) (a+a \sin (c+d x))^{3/2}}{d}+\frac {1}{2} (3 a) \int \csc (c+d x) \sqrt {a+a \sin (c+d x)} \, dx\\ &=\frac {11 a^2 \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {5 a \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) (a+a \sin (c+d x))^{3/2}}{d}-\frac {\left (3 a^2\right ) \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}\\ &=-\frac {3 a^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}+\frac {11 a^2 \cos (c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {5 a \cos (c+d x) \sqrt {a+a \sin (c+d x)}}{3 d}-\frac {\cot (c+d x) (a+a \sin (c+d x))^{3/2}}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 233, normalized size = 1.93 \begin {gather*} -\frac {a \csc ^4\left (\frac {1}{2} (c+d x)\right ) \sqrt {a (1+\sin (c+d x))} \left (14 \cos \left (\frac {1}{2} (c+d x)\right )-9 \cos \left (\frac {3}{2} (c+d x)\right )+\cos \left (\frac {5}{2} (c+d x)\right )-14 \sin \left (\frac {1}{2} (c+d x)\right )+9 \log \left (1+\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-9 \log \left (1-\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-9 \sin \left (\frac {3}{2} (c+d x)\right )-\sin \left (\frac {5}{2} (c+d x)\right )\right )}{3 d \left (1+\cot \left (\frac {1}{2} (c+d x)\right )\right ) \left (\csc \left (\frac {1}{4} (c+d x)\right )-\sec \left (\frac {1}{4} (c+d x)\right )\right ) \left (\csc \left (\frac {1}{4} (c+d x)\right )+\sec \left (\frac {1}{4} (c+d x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 6.25, size = 144, normalized size = 1.19
method | result | size |
default | \(-\frac {\left (1+\sin \left (d x +c \right )\right ) \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, \left (\sin \left (d x +c \right ) \left (2 \left (a -a \sin \left (d x +c \right )\right )^{\frac {3}{2}} \sqrt {a}-12 \sqrt {a -a \sin \left (d x +c \right )}\, a^{\frac {3}{2}}+9 \arctanh \left (\frac {\sqrt {a -a \sin \left (d x +c \right )}}{\sqrt {a}}\right ) a^{2}\right )+3 \sqrt {a -a \sin \left (d x +c \right )}\, a^{\frac {3}{2}}\right )}{3 \sin \left (d x +c \right ) \sqrt {a}\, \cos \left (d x +c \right ) \sqrt {a +a \sin \left (d x +c \right )}\, d}\) | \(144\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 315 vs.
\(2 (105) = 210\).
time = 0.36, size = 315, normalized size = 2.60 \begin {gather*} \frac {9 \, {\left (a \cos \left (d x + c\right )^{2} - {\left (a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - a\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - 4 \, {\left (\cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right ) + 3\right )} \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right ) - 3\right )} \sqrt {a \sin \left (d x + c\right ) + a} \sqrt {a} - 9 \, a \cos \left (d x + c\right ) + {\left (a \cos \left (d x + c\right )^{2} + 8 \, a \cos \left (d x + c\right ) - a\right )} \sin \left (d x + c\right ) - a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1}\right ) + 4 \, {\left (2 \, a \cos \left (d x + c\right )^{3} - 8 \, a \cos \left (d x + c\right )^{2} + a \cos \left (d x + c\right ) - {\left (2 \, a \cos \left (d x + c\right )^{2} + 10 \, a \cos \left (d x + c\right ) + 11 \, a\right )} \sin \left (d x + c\right ) + 11 \, a\right )} \sqrt {a \sin \left (d x + c\right ) + a}}{12 \, {\left (d \cos \left (d x + c\right )^{2} - {\left (d \cos \left (d x + c\right ) + d\right )} \sin \left (d x + c\right ) - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.29, size = 183, normalized size = 1.51 \begin {gather*} \frac {\sqrt {2} {\left (16 \, a \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, \sqrt {2} a \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - 48 \, a \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {12 \, a \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{2 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}\right )} \sqrt {a}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^2\,{\left (a+a\,\sin \left (c+d\,x\right )\right )}^{3/2}}{{\sin \left (c+d\,x\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________